package com.enmo.action;

import java.io.IOException;
import java.io.PrintWriter;

import org.apache.struts2.ServletActionContext;
import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Result;

public class AirAction extends BaseAction{

	private static final long serialVersionUID = 1L;

	@Action(
			value = "airtem"/*,
			results = {
				@Result(name = "success" , location = "error.jsp" , type = "dispatcher"),
				@Result(name = "error" , location = "error.jsp" , type = "dispatcher")
			}*/
	)
	public void AirTem() {
		PrintWriter printWriter = null;
		try {
			printWriter = ServletActionContext.getResponse().getWriter();
			printWriter.write("http://www.baidu.com");// 往前台写入数据流
			//return SUCCESS;
		} catch (IOException e) {
			System.out.println("往前台页面写入数据时IO异常!");
			//return ERROR;
		} finally {
			printWriter.close();
		}
	}
	
	private String msg;
	
	@Action(
			value = "airtem2",
			results = {
				@Result(name = "success" , location = "airtem.jsp" , type = "dispatcher"),
				@Result(name = "error" , location = "error.jsp" , type = "dispatcher")
			}
			)
	public String AirTem2() {
		//System.out.println("5555555" + msg);
		//System.out.println("airtem2");
		return SUCCESS;
	}

	//get set
	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}
}
